package com.oig.auth.api.factory;

import com.oig.auth.api.SystemService;
import com.oig.auth.api.fallback.SystemServiceFallbackImpl;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class SystemFallbackFactory implements FallbackFactory<SystemService> {


    @Override
    public SystemService create(Throwable cause) {
        SystemServiceFallbackImpl systemServiceFallback = new SystemServiceFallbackImpl();
        systemServiceFallback.setCause(cause);
        return systemServiceFallback;
    }

}
